﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserMaintenance.aspx.cs" Inherits="MeetingMinutesManager.Maintenance.UserMaintenance" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>User Maintenance</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="grvUsers" runat="server" AllowPaging="True" OnRowCommand="grvUsers_OnRowCommand"
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
            DataKeyNames="id" DataSourceID="SqlDataSourceUsers" ForeColor="#333333" 
            GridLines="None">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:ButtonField CommandName="ApproveUser" Text="Approve" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="team" HeaderText="team" SortExpression="team" />
                <asp:BoundField DataField="usr_name" HeaderText="usr_name" 
                    SortExpression="usr_name" />
                <asp:BoundField DataField="password" HeaderText="password" 
                    SortExpression="password" />
                <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
                <asp:BoundField DataField="mgr_id" HeaderText="mgr_id" 
                    SortExpression="mgr_id" />
                <asp:BoundField DataField="role" HeaderText="role" SortExpression="role" />
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="is_approved" HeaderText="is_approved" 
                    SortExpression="is_approved" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSourceUsers" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
            DeleteCommand="DELETE FROM [usr] WHERE [id] = ?" 
            InsertCommand="INSERT INTO [usr] ([team], [usr_name], [password], [email], [mgr_id], [role], [id], [is_approved]) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" 
            ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" 
            SelectCommand="SELECT [team], [usr_name], [password], [email], [mgr_id], [role], [id], [is_approved] FROM [usr] ORDER BY [team], [usr_name]" 
            UpdateCommand="UPDATE [usr] SET [team] = ?, [usr_name] = ?, [password] = ?, [email] = ?, [mgr_id] = ?, [role] = ?, [is_approved] = ? WHERE [id] = ?">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="team" Type="Int32" />
                <asp:Parameter Name="usr_name" Type="String" />
                <asp:Parameter Name="password" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="mgr_id" Type="Int32" />
                <asp:Parameter Name="role" Type="Int32" />
                <asp:Parameter Name="is_approved" Type="Int32" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="team" Type="Int32" />
                <asp:Parameter Name="usr_name" Type="String" />
                <asp:Parameter Name="password" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="mgr_id" Type="Int32" />
                <asp:Parameter Name="role" Type="Int32" />
                <asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="is_approved" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
